import { request } from "@/utils/request";

export const apiLoginByPhone = (data: any) => {
  return request({
    url: "/getWxInfo",
    method: "POST",
    data,
  });
};

// 获取openid
export const apiLoginByUnionid = (data: any) => {
  return request({
    url: "/getUnionid",
    method: "POST",
    data,
  });
};
// 微信登录
export const apiLogin = (data: any) => {
  return request({
    url: "/login",
    method: "POST",
    data,
  });
};
// 微信授权 不需要手机号
export const apiEmpower = (data: any) => {
  return request({
    url: "/empower",
    method: "POST",
    data,
  });
};

// 微信授权2 需要手机号
export const apiRegister = (data: any) => {
  return request({
    url: "/register",
    method: "POST",
    data,
  });
};

// 发送验证码
export const sendSms = (data: any) => {
  return request({
    url: "/sms/send?phone=" +data.phone,
    method: "POST",
    // data: JSON.stringify(data),
    // data,
    // header: {
    //   "content-type": "multipart/form-data",
    // },
  });
};

// h5登录
export const h5Login = (data: any) => {
  return request({
    url: "/h5/login",
    method: "POST",
    data,
  });
};

// 协议查询 http://localhost:8080/leshi/user/defaultSetting

export const defaultSetting = (data: any) => {
  return request({
    url: "/user/defaultSetting",
    method: "POST",
    data,
  });
};